def NgramNorm(n1, n2, k=2):
    n1 = db.query(News).filter_by(news_id=n1).one().content
    n2 = db.query(News).filter_by(news_id=n2).one().content
    return string_kernel(n1, n2, k) / float((string_kernel(n1, n1, k)) * (string_kernel(n2, n2, k)))

def Ngram(n1, n2, k=2):
    n1 = db.query(News).filter_by(news_id=n1).one().content
    n2 = db.query(News).filter_by(news_id=n2).one().content
    return string_kernel(n1, n2, k)

# Ngram: 2, 147
# WS: 249, 183 sta si dejansko zelo podobna